<template>
  <div class="one-map-chart-tooltip">
    <div>
      <div class="tooltip-label">{{ label }}</div>
      <div v-for="(item, index) in list" :key="index" class="count-item" :style="{width}">
        <div class="circle" :style="{background:item.color2}">
          <div class="inner-circle" :style="{background:item.color1}"></div>
        </div>
        <span class="count-item-value ellipsis" :style="{color:item.color1}" :title="item.value">{{ item.value }}</span>
        <span class="count-item-unit" v-if="item.unit">{{ item.unit }}</span>
      </div>
    </div>
  </div>
</template>

<script>
export default {
  name: 'ChartTooltip',
  props: {
    label: null,
    width:null,
    list: Array,
    compare:{
      type:Boolean,
      default:false,
    },
    compareValue:{
      type:String,
      default:'flat'
    }
  },
};
</script>

<style lang="less" scoped>
.one-map-chart-tooltip {
  padding: 8px 16px;
  border: 1px solid rgba(175, 186, 253, 0.4);
  backdrop-filter: blur(10px);
  background: rgba(0, 0, 0, 0.2);
  font-family: ShiShangJianTi, serif;
  display: flex;
  align-items: center;

  .tooltip-label {
    font-size: 14px;
    font-weight: 500;
    line-height: 20px;
    color: rgba(255, 255, 255, 0.6);
  }

  .count-item {
    margin-top: 4px;
    width: 164px;
    height: 32px;
    line-height: 32px;
    border-radius: 4px;
    color: #19C0FF;
    display: flex;
    flex-direction: row;
    align-items: center;

    //.count-item-label {
    //  flex: none;
    //  margin-right: 8px;
    //}

    .circle {
      box-sizing: border-box;
      width: 10px;
      height: 10px;
      border-radius: 50%;
      background: rgba(25, 192, 255, 0.4);
      display: flex;
      align-items: center;
      justify-content: center;

      .inner-circle {
        width: 6px;
        height: 6px;
        border-radius: 50%;
        background: #19C0FF;
      }
    }

    .count-item-value {
      font-size: 20px;
      margin-left: 8px;
      color: #19C0FF;
      margin-right: 10px;
    }
  }
}
</style>
